<?php

/**
 * @author PeoneEr
 * @method sql()
 */
require_once "core/db.php";

class Mchange1 extends DB {

    private $_query;

    protected function updatePassword($new_password, $login, $old_password) {
        /**
         * @param strign $login
         * @param mixed $new_password
         * @param mixed $old_password
         * @var string $query
         * @return true or false
         */
        DB::getInstance()->openConnectionToGS();
        $this->_query = "UPDATE `account_data` SET `password` = '$new_password' WHERE `name` = '$login' AND `password` = '$old_password' ";
        return DB::getInstance()->sql($this->_query);
        DB::getInstance()->closeConnection();
        unset($this->_query);
    }

}

?>
